﻿@model Bricks.Site.Models.ProjectContract.FinishedProjectInfoView

@{
    ViewBag.Title = "预览项目";
    Layout = "~/Views/Shared/_UserPage.cshtml";
}

@*实现对EasyUI的DataGird控件操作的JS代码*@
<script type="text/javascript">
    $(function () {
        var instanceID = $("#hID").val();
        var tag = "ProphaseManagement/FinishedProjectInfo/Attachment";
        initTable(instanceID, tag);
    });

    function initTable(instanceID, tag) {
        $('#documentGrid').datagrid({
            //url: '/Document/GetDocumentList?instanceID=681764fd-aef8-4dcf-84bd-a2d700ffc9a0&Tag=Test',  //开发期测试
            url: '/Document/GetDocumentList?instanceID=' + instanceID + '&Tag=' + tag,  //运行期使用
            nowrap: true,
            autoRowHeight: true,
            striped: true,
            collapsible: true,
            rownumbers: true,
            remoteSort: false,
            idField: 'ID',
            singleSelect: true,
            //queryParams: queryData,
            columns: [[
                {
                    title: '文件名', field: 'FileName', width: 220,
                    formatter: function (value, row, index) {
                        return '<a href="' + row["FilePath"] + '">' + value + '</a> ';
                    }
                },
                { title: '文件大小', field: 'FileSize', width: 70, sortable: true },
                { field: 'UploadUserID', hidden: true },
                { title: '上传人', field: 'UploadUser', width: 80, sortable: true },
                { title: '上传时间', field: 'UploadTime', width: 100, sortable: true }

            ]],
            toolbar: '#documentToolBar'
        });
    }
</script>

<div class="frombox datagrid-body" style="padding-bottom: 5px;">
    <form id="project-model" method="post">
        <table class="datagrid-btable" border="0" cellspacing="0" cellpadding="0">
            <tr class="datagrid-row">
                <td class="th">
                    <div class="datagrid-cell">项目名称</div>
                </td>
                <td class="td">
                    <div class="datagrid-cell">
                        <input name="ProjectName" class="easyui-textbox" data-options="required:true" value="@Model.ProjectName" readonly />
                    </div>
                </td>
                <td class="rth">
                    <div class="datagrid-cell">完工时间</div>
                </td>
                <td class="td">
                    <div class="datagrid-cell">
                        <input name="FinishTime" class="easyui-datebox" data-options="required:false,disabled:true" value="@Model.FinishTime" readonly />
                    </div>
                </td>
            </tr>
            <tr class="datagrid-row">
                <td class="th">
                    <div class="datagrid-cell">概算金额</div>
                </td>
                <td class="td">
                    <div class="datagrid-cell">
                        <input name="PlanAccount" class="easyui-textbox" data-options="required:false" value="@Model.PlanAccount" readonly />
                    </div>
                </td>
                <td class="rth">
                    <div class="datagrid-cell">决算金额</div>
                </td>
                <td class="td">
                    <div class="datagrid-cell">
                        <input name="FinalAccount" class="easyui-textbox" data-options="required:false" value="@Model.FinalAccount" readonly />
                    </div>
                </td>
            </tr>
            <tr class="datagrid-row">
                <td class="th">
                    <div class="datagrid-cell">批复文号</div>
                </td>
                <td class="td">
                    <div class="datagrid-cell">
                        <input name="OfficialNum" class="easyui-textbox" data-options="required:false" value="@Model.OfficialNum" readonly />
                    </div>
                </td>
                <td class="rth">
                    <div class="datagrid-cell">批复时间</div>
                </td>
                <td class="td">
                    <div class="datagrid-cell">
                        <input name="OfficialTime" class="easyui-datebox" data-options="required:false,disabled:true" value="@Model.OfficialTime" readonly />
                    </div>
                </td>
            </tr>
            <tr class="datagrid-row">
                <td class="th">
                    <div class="datagrid-cell">办理部门及人员</div>
                </td>
                <td class="td" colspan="3">
                    <div class="datagrid-cell">
                        <textarea name="RegisterDepartmentAndUser" cols="68" rows="1" style="width: 510px;background:#eeeeee;" readonly>@Model.RegisterDepartmentAndUser</textarea>
                    </div>
                </td>
            </tr>
            <tr class="datagrid-row">
                <td class="th">
                    <div class="datagrid-cell">附件</div>
                </td>
                <td class="td" colspan="3">
                    <div class="datagrid-cell">
                        <table id="documentGrid" style="height: 100px;"></table>
                    </div>
                </td>
            </tr>
        </table>
        <input id="hID" name="ID" type="hidden" value="@Model.ID" />
        <input name="RegisterUserID" type="hidden" value="@Model.RegisterUserID" />
    </form>
</div>
